package com.zyc.loadbalance.impl;

import com.zyc.loadbalance.AbstractLoadBalance;
import com.zyc.remoting.dto.RpcRequest;

import java.util.List;
import java.util.Random;

/**
 * @author zyc
 * @create 2022--05--27 10:51
 */
public class RandomLoadBalance extends AbstractLoadBalance {
    @Override
    protected String doSelect(List<String> serviceUrlList, RpcRequest rpcRequest) {
        Random random = new Random();
        return serviceUrlList.get(random.nextInt(serviceUrlList.size()));
    }
}
